package middleware

import (
	"net/http"
)

//JWTMiddleware JWT验证中间件
type JWTMiddleware struct {
	next http.Handler
}

func (jwt *JWTMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	//auth:=r.Header.Get("Authorization")
	//if auth==""{
	//	w.WriteHeader(http.StatusUnauthorized)
	//	return
	//}
	//log.Printf("auth信息：%v",auth)

	jwt.next.ServeHTTP(w, r)
}

func NewJWTMiddleware(handler http.Handler)*JWTMiddleware{
	return &JWTMiddleware{next:handler}
}


